/*
 * @Author: error: git config user.name & please set dead value or install git
 * @Date: 2023-11-24 09:26:28
 * @LastEditors: error: git config user.name & please set dead value or install git
 * @LastEditTime: 2023-12-18 10:22:56
 * @FilePath: \haixiaoke-enterprise-reconstruction\src\api\contract\template.js
 * @Description:
 */
import request from "@/utils/request";

// 查询合同模板列表
export function listContractTemplate(query) {
  return request({
    url: "/enterprise/contract/contractTemplate/list",
    method: "get",
    params: query,
  });
}
// 新增合同模板
export function addContractTemplate(data) {
  return request({
    url: "/enterprise/contract/contractTemplate",
    method: "post",
    data: data,
  });
}
// 查询合同模板详情(路径传退订id)
export function getContractTemplate(id) {
  return request({
    url: "/enterprise/contract/contractTemplate/" + id,
    method: "get",
  });
}

//编辑合同模板
export function updateContractTemplate(data) {
  return request({
    url: "/enterprise/contract/contractTemplate",
    method: "put",
    data: data,
  });
}

// 删除合同模板(路径传退订id)
export function delContractTemplate(id) {
  return request({
    url: "/enterprise/contract/contractTemplate/" + id,
    method: "delete",
  });
}
//禁用/启用合同模板
export function changeUsageStatus(templateId, usageStatus) {
  const data = {
    templateId,
    usageStatus,
  };
  return request({
    url: "/enterprise/contract/contractTemplate/usageStatus",
    method: "put",
    data: data,
  });
}

//统计合同模板数量
export function getContractTemplateStatistics() {
  return request({
    url: "/enterprise/contract/contractTemplate/statistics",
    method: "get",
  });
}
